import React from 'react'
import Film from '../views/Film';
import Center from '../views/Center';
import Cinema from '../views/Cinema';
import {Route,Routes} from 'react-router-dom'
import Redirect from '../Components/Redirect';
import NotFound from '../views/NotFound';
import Search from '../views/Search';
import Nowplaying from '../views/films/Nowplaying';
import Comingsoon from '../views/films/Comingsoon';
import Detail from '../views/Detail';
export default function MRouter() {
    return (
        <Routes>
            {/* <Route path="/" element={<Film />} /> */}
            {/* <Route index element={<Film />} /> */}
            <Route path="/films" element={<Film />}>
                {/* <Route index element={<Nowplaying />} /> */}
                <Route index element={<Redirect to="/films/nowplaying"/>} />
                <Route path="nowplaying" element = {<Nowplaying/>}/>
                <Route path="comingsoon" element = {<Comingsoon/>}/>
            </Route>
            <Route path="/cinemas" element={<Cinema />} />
            <Route path="/cinemas/search" element={<Search />} />
            <Route path="/center" element={<Center />} />
            <Route path="/detail/:myId" element={<Detail />} />

            {/* <Route path="*" element={<Navigate to="/films"/>}/>  */}
            <Route path="/" element={<Redirect to="/films"/>}/>
            <Route path="*" element={<NotFound/>}/>
        </Routes>
    )
}
